<include file="Public:header"/>
<div class="row">
    <form action="" method="post">
        是否自动领取：<input type="checkbox"
        <notempty name="login_user['is_auto_pull']"> checked="checked"</notempty>
        value="1" id="isAutoPull"/>
    </form>
</div>
<div class="alert alert-error" id="alert-error" style="display: none;">
</div>
<notempty name="nowTask">
    <div class="span4">
        <table class="table">
            <tr>
                <th>{:L('_ID')}</th>
                <th>{:L('_TASK_GO')}</th>
                <th>{:L('_BRAND')}</th>
            </tr>
            <tr>
                <td>{$nowTask.id}</td>
                <td>
                    <if condition="$nowTask['auditReturn']">
                        <a href="{:U('/Task/My/auditReturn/id')}/{$nowTask.id}">{$nowTask.title}</a>
                        <else/>
                        <a href="{:U('/Task/My/task/id')}/{$nowTask.id}">{$nowTask.title}</a>
                    </if>
                </td>
                <td>
                    {$brand.name}
                </td>
            </tr>
        </table>
    </div>
</notempty>
<notempty name="waitingAuditTasks">
    <div class="span4">
        <table class="table">
            <tr>
                <th>{:L('_ID')}</th>
                <th>{:L('_WAITTING_AUDIT_LIST')}</th>
            </tr>
            <foreach name="waitingAuditTasks" item="task">
                <tr>
                    <td>{$task.id}</td>
                    <td>{$task.title}</td>
                </tr>
            </foreach>
        </table>
    </div>
</notempty>
<notempty name="taskAuditReturns">
    <div class="span4">
        <table>
            <tr>
                <th>{:L('_ID')}</th>
                <th>{:L('_TASK_SUBMIT_RETURN')}</th>
            </tr>
            <foreach name="taskAuditReturns" item="task">
                <tr>
                    <td>{$task.tid}</td>
                    <td>{$task.title}</td>
                </tr>
            </foreach>
        </table>
    </div>
</notempty>
<notempty name="returnTasks">
    <div class="span4">
        <table>
            <tr>
                <th>{:L('_ID')}</th>
                <th>{:L('_TASK_RETURN')}</th>
            </tr>
            <foreach name="taskAuditReturns" item="task">
                <tr>
                    <td>{$task.tid}</td>
                    <td>{$task.title}</td>
                </tr>
            </foreach>
        </table>
    </div>
</notempty>
<include file="Public:footer"/>
<script type="text/javascript" src="__STATIC__/task/js/task.js"></script>
<script type="text/javascript">
    $(function () {
        <empty name="nowTask">
            <notempty name="login_user['is_auto_pull']">
                    $('body').everyTime('5s', 'handOut', handOut);
            </notempty>
        </empty>
        $("#isAutoPull").change(function () {
            var isChe = 1;
            if ($(this).attr("checked")) {
                isChe = 1;
                $('body').everyTime('5s', 'handOut', handOut);
            } else {
                isChe = 0;
                $('body').stopTime('handOut');
            }
            var url = "{:U('/Task/Member/autoPull/auto')}/" + isChe;
            $.getJSON(url, function (data) {
                alert(data.info);
            });
        });
    });
</script>